# This is a config file for BeeGFS management nodes.
# http://www.beegfs.com


# --- [Table of Contents] ---
#
# 1) Settings
# 2) Command Line Arguments
# 3) Basic Settings Documentation
# 4) Advanced Settings Documentation


#
# --- Section 1.1: [Basic Settings] ---
#

storeMgmtdDirectory      = {{ beegfs_mgmtd_dir }}
storeAllowFirstRunInit   = true

sysAllowNewServers       = true
sysAllowNewTargets       = true


#
# --- Section 1.2: [Advanced Settings] ---
#

connAuthFile                           =
connBacklogTCP                         = 128
connInterfacesFile                     =
connMgmtdPortTCP                       = 8008
connMgmtdPortUDP                       = 8008
connNetFilterFile                      =
connPortShift                          = 0

logLevel                               = 2
logNoDate                              = false
logNumLines                            = 50000
logNumRotatedFiles                     = 5
logStdFile                             = /var/log/beegfs-mgmtd.log

quotaQueryGIDFile                      =
quotaQueryGIDRange                     =
quotaQueryUIDFile                      =
quotaQueryUIDRange                     =
quotaQueryType                         = system
quotaQueryWithSystemUsersGroups        = false
quotaUpdateIntervalMin                 = 10

runDaemonized                          = true

sysTargetOfflineTimeoutSecs            = 90

tuneClientAutoRemoveMins               = 30
tuneNumWorkers                         = 16

tuneMetaDynamicPools                   = true
tuneMetaInodesLowLimit                 = 10M
tuneMetaInodesEmergencyLimit           = 1M
tuneMetaSpaceLowLimit                  = 10G
tuneMetaSpaceEmergencyLimit            = 3G
tuneStorageDynamicPools                = true
tuneStorageInodesLowLimit              = 10M
tuneStorageInodesEmergencyLimit        = 1M
tuneStorageSpaceLowLimit               = 1T
tuneStorageSpaceEmergencyLimit         = 20G


#
# --- Section 1.3: [Enterprise Features] ---
#
# See end-user license agreement for definition and usage limitations of
# enterprise features.
#

quotaEnableEnforcement                 = false


#
# --- Section 2: [Command Line Arguments] ---
#

# Use the command line argument "cfgFile=/etc/anotherconfig.conf" to
# specify a different config file for beegfs-mgmtd.
#
# All other options in this file can also be used as command line
# arguments, overriding the corresponding config file values.


#
# --- Section 3: [Basic Settings Documentation] ---
#

# [storeMgmtdDirectory]
# The absolute path and name of a directory where the file system can store its
# management data.
# Default: <none>

# [storeAllowFirstRunInit]
# Enables or disables daemon startup with an uninitialized storage directory.
# This can be used to make sure that the daemon does not run when the storage
# partition is not mounted (e.g. because it needs repair after a power outage).
# Note: This setting must be enabled during first startup of the daemon, but
#    may be disabled afterwards.
# Default: true

# [sysAllowNewServers]
# Specifies whether new servers can be added to the system. If set to false,
# registration requests of new servers will be rejected. It is highly
# recommended to set this option to false after initial setup to avoid
# accidental registration of new servers.
# Default: true

# [sysAllowNewTargets]
# Specifies whether new storage targets can be added to the system. If set to
# false, registration requests of new targets will be rejected. It is highly
# recommended to set this option to false after initial setup to avoid
# accidental registration of new targets.
# Default: true


#
# --- Section 4: [Advanced Settings Documentation] ---
#

#
# --- Section 4.1: [Connections & Communication] ---
#

# [connAuthFile]
# The path to a file that contains a shared secret for connection based
# authentication. Only peers that use the same shared secret will be able to
# connect.
# Default: <none>

# [connBacklogTCP]
# The TCP listen backlog.
# Default: 64

# [connInterfacesFile]
# The path to a text file that specifies the names of the interfaces, which
# may be used for communication. One interface per line. The line number also
# defines the priority of the interface.
# Example: "ib0" in the first line, "eth0" in the second line.
# Values: This setting is optional. If unspecified, all available interfaces
#    will be used and priorities will be assigned automatically.
# Note: This has no influence on outgoing connections. The information is sent
#    to other hosts to inform them about possible communication paths.
# Default: <none>

# [connMgmtdPortUDP], [connMgmtdPortTCP]
# The UDP and TCP ports of the management node.
# Default: 8008

# [connNetFilterFile]
# The path to a text file that specifies allowed IP subnets, which may be used
# for outgoing communication. One subnet per line in classless notation (IP
# address and number of significant bits).
# Example: "192.168.10.0/24" in the first line, "192.168.20.0/24" in the second
#    line.
# Values: This setting is optional. If unspecified, all addresses are allowed
#    for outgoing communication.
# Default: <none>

# [connPortShift]
# Shifts all following UDP and TCP ports according to the specified value.
# Intended to make port configuration easier in case you do not want to
# configure each port individually.
# Default: 0


#
# --- Section 4.2: [Logging] ---
#

# [logLevel]
# Defines the amount of output messages. The higher this level, the more
# detailed the log messages will be.
# Note: Levels above 3 might decrease performance.
# Default: 2 (Max: 5)

# [logNoDate]
# Defines whether "date & time" (=false) or the current "time only" (=true)
# should be logged.
# Default: false

# [logNumLines]
# The maximum number of lines per log file.
# Default: 50000

# [logNumRotatedFiles]
# The number of old files to keep when "logNumLines" is reached and the log file
# is rewritten (log rotation).
# Default: 5

# [logStdFile]
# The path and filename of the log file for standard log messages. If no name
# is specified, the messages will be written to the console.
# Default: /var/log/beegfs-mgmtd.log


#
# --- Section 4.3: [Quota Settings] ---
#

# [quotaEnableEnforcement]
# Enables enforcement of user and group quota limits by periodically checking
# if the limits are exceeded.
# Note: This uses quota information provided by the underlying local file
#    systems of the storage targets.
# Note: Set quota limits with "beegfs-ctl --setquota".
# Note: If this option is true, performance might be slightly decreased due to
#    extra information tracking.
# Default: false

# [quotaQueryGIDFile]
# The path to a file which contains the user IDs which needs to be checked by
# the quota enforcement. The GIDs must be a space separted list in a single or
# multiple lines. If quotaQueryType is set to "file" this configuration option
# is required.
# Default: <none>

# [quotaQueryGIDRange]
# The range of group IDs which should be checked for quota enforcement. The
# range must be specified with two numeric values which is separated by a comma.
# If quotaQueryType is set to "range" this configuration option is required.
# Note: Do not define ranges too big because this will decrease the performance.
# Default: <none>

# [quotaQueryUIDFile]
# The path to a file which contains the group IDs which needs to be checked by
# the quota enforcement. The UIDs must be a space separted list in a single or
# multiple lines. If quotaQueryType is set to "file" this configuration option
# is required.
# Default: <none>

# [quotaQueryUIDRange]
# The range of user IDs which should be checked for quota enforcement. The range
# must be specified with two numeric values which is separated by a comma. If
# quotaQueryType is set to "range" this configuration option is required.
# Note: Do not define ranges too big because this will decrease the performance.
# Default: <none>

# [quotaQueryType]
# Defines the type to get the user and group IDs. This can be "system" to get
# the user and group IDs from the local system which may be connected to an
# LDAP or some other user management system. The second valid value is "range"
# which must be specified in quotaQueryUIDRange and quotaQueryGIDRange. In this
# case all IDs of user ID range and the group ID range will be queried. The
# third valid value is "file" which reads the UIDs and GIDs from files. The path
# to the files must be specified in quotaQueryUIDFile and quotaQueryGIDFile.
# Note: When the user management system is slow it can decrease the performance.
# Note: Do not define ranges too big because this will decrease the performance.
# Default: system

# [quotaQueryWithSystemUsersGroups]
# Enables also system users/groups to be checked for quota enforcement.
# default: false

# [quotaUpdateIntervalMin]
# The interval in minutes to query the storage servers for the used quota.
# Note: A smaller interval will reduce the time until an exceeded quota limit
#    is noticed, but will also put more load on the system and thus might
#    reduce performance.
# Default: 10


#
# --- Section 4.4: [Startup] ---
#

# [runDaemonized]
# Detach the process from its parent (and from stdin/-out/-err).
# Default: true


#
# --- Section 4.5: [System Settings] ---
#

# [sysTargetOfflineTimeoutSecs]
# Timeout until targets on a storage server are considered offline when no
# target state are received from that server.
# Note: Too low values might lead to false positive detection of offline
#    servers.
# Note: Raising this might cause systemd to kill the mgmtd service prematurely.
#       If this value is raised above 240, and systemd is being used, the
#       TimeoutStopSec value in the service file should be adapted accordingly.
# Values: time in seconds
# Default: 180

#
# --- Section 4.6: [Tuning] ---
#

# [tuneClientAutoRemoveMins]
# The time (in minutes) after which an unreachable node is assumed to be dead
# and thus will be removed from the file system, which will release all
# associated resources, such as open file handles.
# Note: 0 disables automatic removal.
# Note: A value greater than 0 is highly recommended for clients to allow the
#    automatic release of old file handles.
# Default: Client: 30

# [tuneNumWorkers]
# The number of worker threads. Should be at least 3. A value of up to twice
# the number of CPU cores of your machine is the recommended choice.
# Note: The management daemon does not use a lot of CPU cyles and is not
#    critical for file system performance.
# Default: 4

# [tuneNumQuotaWorkers]
# The number of worker threads used for retrieval of quota information from
# storage servers.
# Default: 8

# [tune{Meta,Storage}DynamicPools]
# Temporarily raise the Low/Emergency limits if the spread (difference in free
# capacity between the targets with the most and the least free space) becomes
# too large. This will move targets to a lower pool earlier if there are other
# targets with much more free capacity.

# [tune{Meta,Storage}{Space,Inodes}LowLimit]
# [tune{Meta,Storage}{Space,Inodes}EmergencyLimit]
# The free space pool thresholds. If a metadata or storage target is below a
# threshold, it will only be used to store new files and directories when no
# higher class targets are available (i.e. while there are targets in the
# "normal" pool, no targets from the "low" pool will be used.)
# Note: Preferred target settings of a client will be ignored if it helps to
#    avoid using targets from the emergency class.
# Default: Space: Meta: 10G/3G; Storage: 512G/10G
#          Inodes: Meta: 10M/1M; Storage: 10M/1M

# [tune{Meta,Storage}{Space,Inodes}NormalSpreadThreshold]
# [tune{Meta,Storage}{Space,Inodes}LowSpreadThreshold]
# [tune{Meta,Storage}{Space,Inodes}LowDynamicLimit]
# [tune{Meta,Storage}{Space,Inodes}EmergencyDynamicLimit]
# Only effective if tune{Meta,Storage}DynamicPools is enabled.
# Whenever the spread (see above) of the free capacities in the normal / low
# class of storage targets is above this threshold, the StorageLowLimit /
# StorageEmergencyLimit is temporarily raised to StorageLowDynamicLimit /
# StorageEmergencyDynamicLimit.
# When the {Normal,Low}SpreadThreshold values are set to 0, the value from the
# corresponding {Low,Emergency}Limit is used for the spread threshold.
# When the {Low,Emergency}DynamicLimits are set to 0, they are automatically
# assumed as two times the corresponding {Low,Emergency}(non-dynamic)Limit.
# Default: 0
